import React, { Component } from 'react'
import { HashRouter as Router, NavLink, Route } from 'react-router-dom'
import './common.css'

const Home = ()=>{
  return <h1>Home</h1>
}
const User = ()=>{
  return <h1>User</h1>
}
const About = ()=>{
  return <h1>About</h1>
}

export default class App extends Component {
  render() {
    return (
      <div>
        <Router>
          <NavLink activeClassName='active' exact to='/'>首页</NavLink>
          <NavLink activeClassName='active' exact to='/user'>我的</NavLink>
          <NavLink activeClassName='active' exact to='/about'>关于</NavLink>
          <Route exact path='/' component={Home}></Route>
          <Route exact path='/user' component={User}></Route>
          <Route exact path='/about' component={About}></Route>
        </Router>
      </div>
    )
  }
}
